#pragma once
#include "HashTable.h"

namespace wyd
{
    template <class K, class GetInt = GetInt<K>>
    class unordered_set
    {
        class SetOfKey
        {
        public:
            const K& operator()(const K& key)
            {
                return key;
            }
        };
    public:
        typedef typename HashList<K, const K, SetOfKey, GetInt>::iterator iterator;
        iterator begin()
        {
            return _h.begin();
        }
        iterator end()
        {
            return _h.end();
        }
        bool insert(const K& key)
        {
            return _h.insert(key).second;
        }
        iterator find(const K& key)
        {
            return _h.find(key);
        }
        iterator erase(const K& key)
        {
            return _h.erase(key);
        }
        size_t size()const
        {
            return _h.size();
        }
        bool empty()const
        {
            return _h.empty();
        }
    private:
        HashList<K, const K, SetOfKey, GetInt> _h;
    };
}